﻿using System.Web.Mvc;
using CandidateManager.Controllers;
using WI.CandidateManager.Business.Objects;
using WI.CandidateManager.Common.Data.Enums;

namespace CandidateManager.Areas.Candidate.Controllers
{
    public class HomeController : AutorizeBaseController
    {
        private CandidateBO candidateBO = new CandidateBO();

        /// <summary>
        /// Indexes this instance.
        /// </summary>
        /// <returns></returns>
        [Authorize]
        public ActionResult Index()
        {
            var candidate = candidateBO.GetCandidateProfile();
            return View(candidate);
        }

        /// <summary>
        /// Groups the list.
        /// </summary>
        /// <returns></returns>
        [Authorize]
        public ActionResult GroupList()
        {
            var candidate = candidateBO.GetCandidateProfile();
            return View(candidate);
        }

        /// <summary>
        /// Tasks the list.
        /// </summary>
        /// <returns></returns>
        [Authorize]
        public ActionResult PendingTaskList()
        {
            var taskList = candidateBO.GetResultList(TaskState.New);
            return View(taskList);
        }

        [Authorize]
        public ActionResult InProgressTaskList()
        {
            var taskList = candidateBO.GetResultList(TaskState.InProgress);
            return View(taskList);
        }

        [Authorize]
        public ActionResult CheckedTaskList()
        {
            var taskList = candidateBO.GetResultList(TaskState.Checked);
            return View(taskList);
        }
    }
}
